# coding=utf-8
# -*- coding: UTF-8 -*-
#
# This file is part of the kernelstudio package.
#
# (c) 2014-2025 zlin <admin@kernelstudio.com>
#
# For the full copyright and license information, please view the LICENSE file
# that was distributed with this source code.
from typing import Any

from api.labeler.category_controller import DocumentCategoryController, DocumentCategoryUpdateDeleteController
from api.labeler.document_controller import DocumentUploaderController, DocumentListController, \
    DocumentUpdateDeleteController
from api.labeler.labels_controller import DocumentLabelsController, DocumentLabelsUpdateDeleteController
from ksai.context import ApplicationInitializer, Application
from ksai.web.api import interceptor


class ApiLabelerInitializer(ApplicationInitializer):

    def initialize(self, app: Application) -> Any:
        interceptor.add_resource(DocumentLabelsController, "/v1/app/labeler/label")
        interceptor.add_resource(DocumentLabelsUpdateDeleteController, "/v1/app/labeler/label/<uuid:uuid>")

        interceptor.add_resource(DocumentCategoryController, "/v1/app/labeler/category")
        interceptor.add_resource(DocumentCategoryUpdateDeleteController, "/v1/app/labeler/category/<uuid:uuid>")

        interceptor.add_resource(DocumentListController, "/v1/app/labeler/document")
        interceptor.add_resource(DocumentUpdateDeleteController, "/v1/app/labeler/document/<uuid:uuid>")
        interceptor.add_resource(DocumentUploaderController, "/v1/app/labeler/document/upload")
